package com.qingneng.web;

import java.util.List;

import org.apache.log4j.Logger;

import com.opensymphony.xwork2.Action;
import com.qingneng.service.sdk.ICustomerInfoService;
import com.qingneng.vo.CustomerInfo;
import com.tbfs.common.BaseAction;

public class LoadCustomerInfoAction extends BaseAction {

	private static final Logger logger = Logger
			.getLogger(LoadCustomerInfoAction.class);

	// init service
	public ICustomerInfoService customerInfoService;

	// 构造函数
	public LoadCustomerInfoAction(ICustomerInfoService customerInfoService) {
		this.customerInfoService = customerInfoService;
	}

	public LoadCustomerInfoAction() {

	}

	private List rows = null;

	private Integer total;

	private CustomerInfo customerInfo;

	public CustomerInfo getCustomerInfo() {
		return customerInfo;
	}

	public void setCustomerInfo(CustomerInfo customerInfo) {
		this.customerInfo = customerInfo;
	}

	private String message;

	private String volidateAccessDataAuth;

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	
	
	public List getRows() {
		return rows;
	}

	public void setRows(List rows) {
		this.rows = rows;
	}

	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	/**
	 * load contractinfo json data
	 * 
	 * @return
	 */
	public String loadData() {
		try {
			
			//初始化查询对象
			if(customerInfo==null){
				customerInfo = new CustomerInfo();
			}
			//分页
			this.processPaginationBean();
			volidateAccessDataAuth = this.volidateAccessDataAuth();
			//所有数据
			if("0".equals(volidateAccessDataAuth)){
				
			}
			
			rows  =  customerInfoService.getCustomerList(customerInfo);
			total = customerInfoService.getCustomerListCounts(customerInfo);
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Action.SUCCESS;
	}
	
}
